import { checkAuthReq } from './../pages/services/admin'
import { useRequest } from 'umi'

function useAuth () {
    const test = useRequest(() => {
        return checkAuthReq()
    })
    const {loading, error, data} = test
    if(loading) {
        return 1
    }
    if (error) {
        return 2
    }
    return data
}
export default useAuth